﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using CrmContacto.Contracts;
using Web.Framework.Svc;
using CrmContacto.Contracts.Contracts.Search;
using CrmContacto.Contracts.Contracts;
using CrmContacto.Contracts.Contracts.Misc;
using CrmContacto.Contracts.Promociones;

namespace CrmContacto.Contracts.Services
{
    [ServiceContract]
    public interface ICrmContactoAdminService
    {
        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        List<CompanyConfiguration> GetCompanyConfigurations();

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        Dictionary<string, string> GetCompanyConfigurationKeyValues(int companyId);

        //[OperationContract]
        //[FaultContract(typeof(WebFrameworkFaultException))]
        //List<MaestroBase> GetCampaniasActivas(int empresaId);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        List<MaestroBase> GetTipoDocumento(int paisId);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        List<MaestroBase> GetProvincias(int paisId);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        List<ReportingConfiguration> GetReportingConfiguration(string name, int empresaId);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        List<MaestroBase> GetCategoriasDeContacto(MaestroBaseSearch searchMaestroBase);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        List<MaestroBase> GetListasDeDistribucion(int empresaId);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        ClienteSearchResult GetCustomers(ServiceOptions options, CustomerSearchParam searchParam);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        Cliente GetCustomerById(ServiceOptions options, int customerId, ClienteByIdOptions clientOptions);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        Cliente SaveCustomer(ServiceOptions options, Cliente customer);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        List<ClienteWrap> SaveCustomerList(ServiceOptions options, List<ClienteWrap> customerList);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        ClienteCantidades GetCantidadDeContactos(int empresaId, DateTime mesEnCurso);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        ClienteBitacora SaveCustomerBitacora(ServiceOptions options, ClienteBitacora clienteBitacora);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        MaestroBase SaveCategoria(ServiceOptions options, MaestroBase categoria, int empresaId);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        void EliminarCategoria(ServiceOptions options, int categoriaId);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        void EliminarContactos(ServiceOptions options, CustomerSearchParam searchParam);

        //[OperationContract]
        //[FaultContract(typeof(WebFrameworkFaultException))]
        //List<Campania> GetCampanias(ServiceOptions options, CampaniaSearch search);

        //[OperationContract]
        //[FaultContract(typeof(WebFrameworkFaultException))]
        //Campania SaveCampania(ServiceOptions options, Campania campania);     

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        List<PlanDeMarketing> GetPlanesDeMarketing(ServiceOptions options, PlanDeMarketingSearch search);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        PlanDeMarketing SavePlanDeMarketing(ServiceOptions options, PlanDeMarketing planDeMarketing);

        //[OperationContract]
        //[FaultContract(typeof(WebFrameworkFaultException))]
        //void AddListaDistribucionesACampania(ServiceOptions options, int campaniaId, List<int> listaDistribucionIds);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        void AddListaDistribucionesAAccionDeMarketing(ServiceOptions options, int accionDeMarketingId, List<int> listaDistribucionIds);

        //[OperationContract]
        //[FaultContract(typeof(WebFrameworkFaultException))]
        //void EliminarListaDistribucionDeCampania(ServiceOptions options, int campaniaId, int listaDistribucionId);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        void EliminarListaDistribucionDeAccionDeMarketing(ServiceOptions options, int accionDeMarketingId, int listaDistribucionId);

        //[OperationContract]
        //[FaultContract(typeof(WebFrameworkFaultException))]
        //void EliminarCampania(ServiceOptions options, int campaniaId);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        void EliminarPlanDeMarketing(ServiceOptions options, int planDeMarketingId);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        List<AccionDeMarketing> GetAccionesDeMarketing(ServiceOptions options, AccionDeMarketingSearch search);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        List<AccionDeMarketingComunicacion> GetAccionesDeMarketingComunicacion(AccionDeMarketingSearch search);

        //[OperationContract]
        //[FaultContract(typeof(WebFrameworkFaultException))]
        //List<CampaniaInstancia> GetCampaniaInstancia(ServiceOptions options, CampaniaInstanciaSearch search);

        //[OperationContract]
        //[FaultContract(typeof(WebFrameworkFaultException))]
        //CampaniaInstancia SaveCampaniaInstancia(ServiceOptions options, CampaniaInstancia campaniaInstancia);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        AccionDeMarketing SaveAccionDeMarketing(ServiceOptions options, AccionDeMarketing accionDeMarketing);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        AccionDeMarketingComunicacion SaveAccionDeMarketingComunicacion(ServiceOptions options, AccionDeMarketingComunicacion accionDeMarketing);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        void EliminarAmbitoDeAccionDeMarketing(ServiceOptions options, int accionDeMarketingId, int puntoDeVentaIds);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        void AddAccionDeMarketingRelacionadaAAccionDeMarketing(ServiceOptions options, int accionDeMarketingId, List<int> accionesDeMarketingRelacionadasIds);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        void EliminarAccionDeMarketingRelacionadaDeAccionDeMarketing(ServiceOptions options, int accionDeMarketingId, int accionDeMarketingRelacionadaId);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        void AddCategoriasAContactos(ServiceOptions options, CustomerSearchParam searchParam, List<int> categoriasIds);

        //[OperationContract]
        //[FaultContract(typeof(WebFrameworkFaultException))]
        //void EliminarCampaniaInstancia(ServiceOptions options, int campaniaInstanciaId);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        void EliminarResultadoDeAccionDeMarketing(ServiceOptions options, int accionDeMarketingId, int resultadoId);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        void AddAmbitoAAccionDeMarketing(ServiceOptions options, int accionDeMarketingId, List<int> puntoDeVentaIds);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        void EliminarAccionDeMarketing(ServiceOptions options, int accionDeMarketingId);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        List<ListaDeDistribucion> GetListaDeDistribucion(ServiceOptions options, ListaDistribucionSearch search);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        ListaDeDistribucion SaveListaDeDistribucion(ServiceOptions options, ListaDeDistribucion listaDistribucion);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        void EliminarListaDeDistribucion(ServiceOptions options, int listaDistribucionId);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        void EliminarContactoDeListaDeDistribucion(ServiceOptions options, int listaDistribucionId, int contactoId);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        void AddListaDistribucionesAConctacto(ServiceOptions options, int contactoId, List<int> listaDistribucionIds);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        void ActivarEntidad(ServiceOptions options, string entidad, int estado, int entidadId);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        List<AccionDeMarketingComunicacionTipo> GetMarketingComunicacionTipo(TipoAccionDeMarketingComunicacionSearch search);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        void EliminarPuntoDeVentaRelacionadoDeAccionDeMarketing(ServiceOptions options, int accionDeMarketingId, int puntoDeVentaId);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        List<AccionDeMarketingEmailResultado> SaveResultadosEmailAccionDeMarketing(ServiceOptions options, int accionDeMarketingComunicacionId, List<AccionDeMarketingEmailResultado> resultadoList);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        List<AccionDeMarketingPromocion> GetAccionesDeMarketingPromocion(AccionDeMarketingSearch search);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        List<AccionDeMarketingPromocionRegla> GetReglasAccionDeMarketing(MaestroBaseSearch search);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        AccionDeMarketingPromocion SaveAccionDeMarketingPromocion(ServiceOptions options, AccionDeMarketingPromocion accionDeMarketing);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        AccionDeMarketingPublicidad SaveAccionDeMarketingPublicidad(ServiceOptions options, AccionDeMarketingPublicidad accionDeMarketing);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        List<AccionDeMarketingPublicidad> GetAccionesDeMarketingPublicidad(AccionDeMarketingSearch search);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        void CambiarEstadoAAccionDeMarketing(ServiceOptions options, int accionDeMarketingId, int estado);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        void CambiarEstadoAPlanDeMarketing(ServiceOptions options, int planDeMarketingId, int estado);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        void EliminarRegla(ServiceOptions options, int reglaId);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        AccionDeMarketingPromocionRegla SaveReglasAccionDeMarketing(ServiceOptions options, AccionDeMarketingPromocionRegla regla);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        AccionDeMarketingComunicacionConfiguracion SaveAccionMarketingConfiguracion(ServiceOptions options, AccionDeMarketingComunicacionConfiguracion configuracion);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        List<AccionDeMarketingComunicacionConfiguracion> GetAccionesMarketingConfiguracion(ServiceOptions options, ConfiguracionAccionMarketingSearch search);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        void EliminarAccionMarketingConfiguracion(ServiceOptions options, string configuracionId);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        AccionDeMarketingComunicacionTipo SaveMarketingComunicacionTipo(ServiceOptions options, AccionDeMarketingComunicacionTipo tipo);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        void EliminarMarketingComunicacionTipo(ServiceOptions options, int tipoId);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        List<PuntoDeVenta> GetPuntoDeVentaDto(ServiceOptions options, PuntoDeVentaSearch search);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        PuntoDeVenta SavePuntoDeVentaDto(ServiceOptions options, PuntoDeVenta ptoVta);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        void EliminarPuntoDeVentaDto(ServiceOptions options, int puntoDeVentaId);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        List<Pais> GetPaisesDto(ServiceOptions options, PaisSearch search);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        Pais SavePaisDto(ServiceOptions options, Pais pais);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        void EliminarPaisDto(ServiceOptions options, int paisId);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        List<Provincia> GetProvinciasDto(ServiceOptions options, MaestroBaseSearch search);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        Provincia SaveProvinciaDto(ServiceOptions options, Provincia provincia);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        void EliminarProvinciaDto(ServiceOptions options, int provinciaId);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        List<TipoMensajeBitacora> GetTipoMensajeBitacora(TipoMensajeBitacoraSearch search);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        TipoMensajeBitacora SaveTipoMensajeBitacora(ServiceOptions options, TipoMensajeBitacora tipoMensaje);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        void EliminarTipoMensajeBitacora(ServiceOptions options, int tipoMensajeId);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        CompanyConfiguration SaveCompanyConfiguration(ServiceOptions options, CompanyConfiguration companyConfiguration);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        List<Producto> GetProductos(ServiceOptions options, ProductoSearch search);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        ParticipantesSearchResult GetParticipantes(ServiceOptions options, ParticipantesSearch searchParam);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        SubPuntoDeVenta SaveSubPuntoDeVenta(ServiceOptions options, SubPuntoDeVenta subPuntoDeVenta);

        [OperationContract]
        [FaultContract(typeof(WebFrameworkFaultException))]
        void RemoveSubPuntoDeVentaFromPdv(ServiceOptions options, int subPuntoDeVentaId);      
    }
}
